package com.yao.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 订单列表
 * </p>
 *
 * @author author
 * @since 2025-01-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("order1")
@ApiModel(value="Order对象", description="订单列表")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "买家姓名")
    @TableField("buyName")
    private String buyName;

    @ApiModelProperty(value = "订单id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "买家电话")
    @TableField("buyPhone")
    private String buyPhone;

    @ApiModelProperty(value = "期望到达日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField("deliveryDate")
    private LocalDate deliveryDate;

    @ApiModelProperty(value = "备注信息")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "收获地址id")
    @TableField("userAddressId")
    private String userAddressId;

    @ApiModelProperty(value = "用户唯一标识")
    @TableField("openId")
    private String openId;

    @TableField(exist = false)
    private List<ShoppingCart> cartList;//购物车列表

    @ApiModelProperty(value = "订单号")
    @TableField("orderNo")
    private String orderNo;

    @ApiModelProperty(value = "订单状态")
    @TableField("orderStatus")
    private int orderStatus;


    public Order() {
    }

    public Order(String buyName, Integer id, String buyPhone, LocalDate deliveryDate, String remarks, String userAddressId, String openId, List<ShoppingCart> cartList, String orderNo, int orderStatus) {
        this.buyName = buyName;
        this.id = id;
        this.buyPhone = buyPhone;
        this.deliveryDate = deliveryDate;
        this.remarks = remarks;
        this.userAddressId = userAddressId;
        this.openId = openId;
        this.cartList = cartList;
        this.orderNo = orderNo;
        this.orderStatus = orderStatus;
    }

    /**
     * 获取
     * @return buyName
     */
    public String getBuyName() {
        return buyName;
    }

    /**
     * 设置
     * @param buyName
     */
    public void setBuyName(String buyName) {
        this.buyName = buyName;
    }

    /**
     * 获取
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取
     * @return buyPhone
     */
    public String getBuyPhone() {
        return buyPhone;
    }

    /**
     * 设置
     * @param buyPhone
     */
    public void setBuyPhone(String buyPhone) {
        this.buyPhone = buyPhone;
    }

    /**
     * 获取
     * @return deliveryDate
     */
    public LocalDate getDeliveryDate() {
        return deliveryDate;
    }

    /**
     * 设置
     * @param deliveryDate
     */
    public void setDeliveryDate(LocalDate deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    /**
     * 获取
     * @return remarks
     */
    public String getRemarks() {
        return remarks;
    }

    /**
     * 设置
     * @param remarks
     */
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    /**
     * 获取
     * @return userAddressId
     */
    public String getUserAddressId() {
        return userAddressId;
    }

    /**
     * 设置
     * @param userAddressId
     */
    public void setUserAddressId(String userAddressId) {
        this.userAddressId = userAddressId;
    }

    /**
     * 获取
     * @return openId
     */
    public String getOpenId() {
        return openId;
    }

    /**
     * 设置
     * @param openId
     */
    public void setOpenId(String openId) {
        this.openId = openId;
    }

    /**
     * 获取
     * @return cartList
     */
    public List<ShoppingCart> getCartList() {
        return cartList;
    }

    /**
     * 设置
     * @param cartList
     */
    public void setCartList(List<ShoppingCart> cartList) {
        this.cartList = cartList;
    }

    /**
     * 获取
     * @return orderNo
     */
    public String getOrderNo() {
        return orderNo;
    }

    /**
     * 设置
     * @param orderNo
     */
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    /**
     * 获取
     * @return orderStatus
     */
    public int getOrderStatus() {
        return orderStatus;
    }

    /**
     * 设置
     * @param orderStatus
     */
    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String toString() {
        return "Order{serialVersionUID = " + serialVersionUID + ", buyName = " + buyName + ", id = " + id + ", buyPhone = " + buyPhone + ", deliveryDate = " + deliveryDate + ", remarks = " + remarks + ", userAddressId = " + userAddressId + ", openId = " + openId + ", cartList = " + cartList + ", orderNo = " + orderNo + ", orderStatus = " + orderStatus + "}";
    }
}
